<template>
  <ul class="home-links clearfix">
    <li
      v-for="(v) in linkArr"
      :key="v.url">
      <a
        class="w-text-bottom-line"
        target="_blank"
        :href="v.link">{{ v.title }}</a>
    </li>
  </ul>
</template>

<script>
  import HomeLinksModel from '@/models/web/HomeLinksModel'

  export default {
    name: "HomeLinks",
    data() {
      return {
        /**
         * 链接模型数组
         */
        linkArr: []
      };
    },
    mounted() {
      this.getAllModels ()
    },
    methods: {
      /**
       * 获取所有数据
       */
      getAllModels() {
        HomeLinksModel.loadAllModels (null, true).then ((dataArr) => {
          this.linkArr = dataArr
        })
      }
    }
  };
</script>

<style lang="scss" scoped>
  .home-links {
    list-style: none;
    line-height: 30px;
    margin: 0;
    padding: 15px;

    li {
      float: left;
      padding: 3px;

      a {
        font-size: 20px;
        color: #666;
      }
    }
  }
</style>
